﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OilCardRecordForm.aspx.cs"
    Inherits="YhmOA.Integrated.Car.OilCardRecordForm" %>

<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link type="text/css" rel="Stylesheet" href="../../Styles/Common.css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.5.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/include.jquery.js"></script>
    <script type="text/javascript" src="../../Scripts/Common.js"></script>
    <script src="../../Scripts/DevEx.js" type="text/javascript"></script>
    <script type="text/javascript">
        function OnTypeChanged(s, e) {
            if (txt_TypeCtrl.GetSelectedIndex() == 1) {
                $("#tr_BankNo").show(500);
                $("#tr_BankPerson").show(500);
                $("#tr_BankName").show(500);
                $("#tr_TAccountNo").hide(500);
                $("#tr_TAccountName").hide(500);
                $("#tr_TAccountBank").hide(500);
                txt_TAccountNoCtrl.SetText("");
                txt_TAccountNameCtrl.SetText("");
                txt_TAccountBankCtrl.SetText("");
                txt_BankNoCtrl.Focus();
                txt_BankPersonCtrl.Focus();
                txt_BankNameCtrl.Focus();
            } else if (txt_TypeCtrl.GetSelectedIndex() == 2) {
                $("#tr_BankNo").hide(500);
                $("#tr_BankPerson").hide(500);
                $("#tr_BankName").hide(500);
                $("#tr_TAccountNo").show(500);
                $("#tr_TAccountName").show(500);
                $("#tr_TAccountBank").show(500);
                txt_BankNoCtrl.SetText("");
                txt_BankPersonCtrl.SetText("");
                txt_BankNameCtrl.SetText("");
                txt_TAccountNoCtrl.Focus();
                txt_TAccountNameCtrl.Focus();
                txt_TAccountBankCtrl.Focus();
            } else {
                $("#tr_BankNo").hide(500);
                $("#tr_BankPerson").hide(500);
                $("#tr_BankName").hide(500);
                $("#tr_TAccountNo").hide(500);
                $("#tr_TAccountName").hide(500);
                $("#tr_TAccountBank").hide(500);
                txt_TAccountNoCtrl.SetText("");
                txt_TAccountNameCtrl.SetText("");
                txt_TAccountBankCtrl.SetText("");
                txt_BankNoCtrl.SetText("");
                txt_BankPersonCtrl.SetText("");
                txt_BankNameCtrl.SetText("");
                txt_TAccountNoCtrl.Focus();
                txt_TAccountNameCtrl.Focus();
                txt_TAccountBankCtrl.Focus();
                txt_BankNoCtrl.Focus();
                txt_BankPersonCtrl.Focus();
                txt_BankNameCtrl.Focus();
            }
        };
        $(document).ready(function () {
            OnTypeChanged();
        });
        function Save(s, e) {
            if (ASPxClientEdit.ValidateEditorsInContainer(null)) {
                cbSaveCtrl.PerformCallback();
                lpSaveCtrl.Show();
                $(this).wijdialog('close');
            }
        };
        function SaveCallback(s, e) {
            if (s.cpIsSucceed == true) {
                lpSaveCtrl.SetText('提交成功');
                parent.Search();
                window.setTimeout(function () { lpSaveCtrl.Hide(); lpSaveCtrl.SetText('正在提交信息,请稍后...'); }, 1500);
            } else {
                lpSaveCtrl.SetText('提交失败');
                window.setTimeout(function () { lpSaveCtrl.Hide(); lpSaveCtrl.SetText('正在提交信息,请稍后...'); }, 1500);
            }
        };
        function OnBankNoChanged(s, e) {
            if (txt_BankNoCtrl.GetSelectedIndex() > -1) {
                txt_BankPersonCtrl.SetText(txt_BankNoCtrl.GetSelectedItem().texts[1]);
                txt_BankNameCtrl.SetText(txt_BankNoCtrl.GetSelectedItem().texts[2]);
            } else {
                txt_BankPersonCtrl.SetText("");
                txt_BankNameCtrl.SetText("");
            }
        };
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="MainRound">
        <div class="MainRoundContent">
            <div class="MainRoundContentW">
                <div class="MainBody">
                    <table class="Table" style="width: 550px">
                        <tr>
                            <td style="width: 120px">
                                充值金额：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_Money" ClientInstanceName="txt_MoneyCtrl" runat="server"
                                    MaxLength="9" NullText="请输入充值金额" TabIndex="1" Width="300px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入充值金额"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                        <RegularExpression ErrorText="只能输入非负数字" ValidationExpression="^\d+(\.\d+)?$" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                充值地点：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_Address" ClientInstanceName="txt_AddressCtrl" runat="server"
                                    MaxLength="50" NullText="请输入充值地点" TabIndex="2" Width="300px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入充值地点"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                充值时间：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxDateEdit ID="txt_Time" ClientInstanceName="txt_TimeCtrl" runat="server" TabIndex="3"
                                    NullText="请选择充值时间" Width="300px" Spacing="0" EditFormat="DateTime" PopupVerticalAlign="TopSides">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择充值时间"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxDateEdit>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                充值方式：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxComboBox ID="txt_Type" runat="server" Width="300px" TabIndex="4" ClientInstanceName="txt_TypeCtrl"
                                    Spacing="0" ClientIDMode="AutoID">
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus"
                                        SelectedIndexChanged="OnTypeChanged" />
                                    <Items>
                                        <dx:ListEditItem Text="现金" Value="1" />
                                        <dx:ListEditItem Text="刷卡" Value="2" />
                                        <dx:ListEditItem Text="转帐" Value="3" />
                                    </Items>
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择充值方式"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请选择充值方式">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr id="tr_BankNo">
                            <td style="width: 120px">
                                刷卡的卡号：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxComboBox ID="txt_BankNo" runat="server" Width="300px" TabIndex="5" ClientInstanceName="txt_BankNoCtrl"
                                    Spacing="0" DropDownStyle="DropDown" IncrementalFilteringMode="Contains" ClientIDMode="AutoID"
                                    ValueType="System.String" DropDownRows="5" TextFormatString="{0}" ValueField="value1">
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus"
                                        TextChanged="OnBankNoChanged" />
                                    <Columns>
                                        <dx:ListBoxColumn FieldName="key" Caption="卡号" Width="120" />
                                        <dx:ListBoxColumn FieldName="value" Caption="人名" Width="60"/>
                                        <dx:ListBoxColumn FieldName="value1" Caption="开户行" Width="150" />
                                    </Columns>
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入刷卡的卡号"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请输入刷卡的卡号">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr id="tr_BankPerson">
                            <td style="width: 120px">
                                刷卡的人名：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_BankPerson" ClientInstanceName="txt_BankPersonCtrl" runat="server"
                                    MaxLength="50" NullText="请输入刷卡的人名" TabIndex="6" Width="300px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入刷卡的人名"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr id="tr_BankName">
                            <td style="width: 120px">
                                刷卡卡号开户行：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_BankName" ClientInstanceName="txt_BankNameCtrl" runat="server"
                                    MaxLength="50" NullText="请输入刷卡卡号开户行" TabIndex="7" Width="300px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入刷卡卡号开户行"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr id="tr_TAccountNo">
                            <td style="width: 120px">
                                转帐账号：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxComboBox ID="txt_TAccountNo" runat="server" Width="300px" TabIndex="8" ClientInstanceName="txt_TAccountNoCtrl"
                                    Spacing="0" DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith" ClientIDMode="AutoID"
                                    ValueType="System.String">
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus"
                                        TextChanged="" />
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入转帐账号"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请输入转帐账号">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr id="tr_TAccountName">
                            <td style="width: 120px">
                                转帐账户名：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_TAccountName" ClientInstanceName="txt_TAccountNameCtrl" runat="server"
                                    MaxLength="50" NullText="请输入转帐账户名" TabIndex="9" Width="300px" ReadOnly="false">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入转帐账户名"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr id="tr_TAccountBank">
                            <td style="width: 120px">
                                转帐账号开户行：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_TAccountBank" ClientInstanceName="txt_TAccountBankCtrl" runat="server"
                                    MaxLength="50" NullText="请输入转帐账号开户行" TabIndex="10" Width="300px" ReadOnly="false">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入转帐账号开户行"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                充值人：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_Person" ClientInstanceName="txt_PersonCtrl" runat="server"
                                    MaxLength="50" NullText="请输入充值人" TabIndex="11" Width="300px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入充值人"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                发票类型：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxComboBox ID="txt_BillType" runat="server" Width="200px" TabIndex="12" ClientInstanceName="txt_BillTypeCtrl"
                                    Spacing="0" ClientIDMode="AutoID">
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus" />
                                    <Items>
                                        <dx:ListEditItem Text="普通发票" Value="1" />
                                        <dx:ListEditItem Text="增值税发票" Value="2" />
                                    </Items>
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择发票类型"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请选择发票类型">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                发票抬头：
                            </td>
                            <td style="width: 330px">
                                <dx:ASPxTextBox ID="txt_BillTitle" ClientInstanceName="txt_BillTitleCtrl" runat="server"
                                    MaxLength="50" NullText="请输入发票抬头" TabIndex="13" Width="300px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入发票抬头"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <table class="TableNoBorder" style="width: 550px">
                        <tr>
                            <td colspan="2" />
                            <td align="left" style="margin-right: 20px; width: 100px">
                                <dx:ASPxButton ID="btnSave" runat="server" Text="保  存" Width="80px" AutoPostBack="false"
                                    TabIndex="14">
                                    <ClientSideEvents Click="Save" />
                                </dx:ASPxButton>
                            </td>
                            <td align="left" style="margin-right: 20px; width: 100px">
                                <dx:ASPxButton ID="btnCancel" runat="server" Text="重  置" Width="80px" TabIndex="15" AutoPostBack="false">
                                    <ClientSideEvents Click="function(s,e){ASPxClientEdit.ClearEditorsInContainer(null);}" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <dx:ASPxCallback ID="cbSave" runat="server" ClientInstanceName="cbSaveCtrl" OnCallback="cbSave_Callback">
                        <ClientSideEvents CallbackComplete="SaveCallback" />
                    </dx:ASPxCallback>
                    <dx:ASPxLoadingPanel ID="lpSave" runat="server" Text="正在提交信息,请稍后..." ClientInstanceName="lpSaveCtrl">
                    </dx:ASPxLoadingPanel>
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
